package service.impl;

import mapper.ArticleMapper;
import mapper.CategoryMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import pojo.Article;
import pojo.Category;
import service.ICategoryService;

import java.util.List;

/**
 * 帖子类型业务层实现类
 */
@Service
public class CategoryServiceImpl implements ICategoryService {
    @Autowired
    private CategoryMapper categoryMapper;
    @Override
    public List<Category> getCategoriesByRoleId(Integer roleId) {
        List<Category> categories = categoryMapper.selectByUserId(roleId);
        return  categories;
    }

    @Override
    public List<Category> getAllCategory() {
        List<Category> categories = categoryMapper.selectAll();
        return categories;
    }
}
